<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>制作试卷</title>
    <!--导入layer-->
    <script src="../jQuery/jquery-1.11.2.js"></script>
    <!--导入layer-->
    <script src="../jQuery/jquery-1.11.2.js"></script>
    <script src="../layer/layer/layer.js"></script>
    <!--导入layui-->
    <link rel="stylesheet" href="../layui/layui/css/layui.css">
    <script src="../layui/layui/layui.js" charset="utf-8"></script>

    <style>
        #div{
            background-color: whitesmoke;
            height: 600px;
            width: 1000px;
            margin-left: 13%;
            margin-top: 5%;
            box-shadow: 5px 5px 5px 0 rgba(0, 0, 0, .05);
            -webkit-box-shadow: #d4d2d2 0px 0px 10px;
            -moz-box-shadow: #d4d2d2 0px 0px 10px;

        }
    </style>

    <script type="text/javascript">
        $(function () {
            //查询所有班级
            $.ajax({
                async:false,
                url:"../ClassServlet?method=findClass",
                type:'GET',
                data:"",
                success:function (data) {
                    data=$.parseJSON(data);
                    var leng=data.json1;
                    var str="<option value=''>"+"--请选择班级名称--"+"</option>";
                    $.each(leng,function (index,item) {
                        str+="<option value="+item.className+">"+item.className+"</option>";
                    });
                    $("#className").append(str);
                    $("#classId").append(str);
                }
            });

            //查询所有课程名称
            $.ajax({
                async:false,
                url:"../CourseServlet?method=findCourse",
                type:'GET',
                data:"",
                success:function (data) {
                    data=$.parseJSON(data);
                    var leng=data.json1;
                    var str="<option value=''>"+"--请选择课程名称--"+"</option>";
                    $.each(leng,function (index,item) {
                        str+="<option value="+item.courseName+">"+item.courseName+"</option>";
                    });
                    $("#courseId").append(str);
                }
            });
        });
    </script>
</head>
<body>
<div id="div">
    <form class="layui-form" method="post" action="../PaperServlet?method=add" lay-filter="example" style="padding-top: 5%;margin-left: 30%" id="main">
        <div class="layui-form-item">
            <label class="layui-form-label" style="font-size: 22px;width: 100px">考试班级</label>
            <div class="layui-input-block" style="width: 250px;margin-left: 20%">
                <select name="classId" id="classId" lay-filter="aihao">
<%--                    <option value="">请选择</option>--%>
<%--                    <option value="1">t281</option>--%>
<%--                    <option value="2">t282</option>--%>
<%--                    <option value="3">t283</option>--%>
<%--                    <option value="4">t285</option>--%>
<%--                    <option value="5">t286</option>--%>
<%--                    <option value="6">t287</option>--%>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="font-size: 22px;width: 100px">考试课程</label>
            <div class="layui-input-block" style="width: 250px;margin-left: 20%">
                <select name="courseId" id="courseId" lay-filter="aihao">
<%--                    <option value="">请选择</option>--%>
<%--                    <option value="1">web应用程序客户端界面设计</option>--%>
<%--                    <option value="2">java程序设计基础</option>--%>
<%--                    <option value="3">Java面向对象</option>--%>
<%--                    <option value="4">Java数据库编程</option>--%>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label" style="font-size: 22px;width: 100px">考试日期</label>
                <div class="layui-input-inline">
                    <input type="text" name="examDate" id="date1" style="width: 250px;margin-left: 12px" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label" style="font-size: 22px;width: 100px">开始时间</label>
            <div class="layui-input-inline">
                <input style="width: 250px;margin-left: 12px" type="text" class="layui-input" name="beginTime" id="test1" placeholder="HH:mm:ss">
            </div>
        </div>
        <br/>
        <br/>
        <div class="layui-inline">
            <label class="layui-form-label" style="font-size: 22px;width: 100px">结束时间</label>
            <div class="layui-input-inline">
                <input style="width: 250px;margin-left: 12px" name="finishTime" type="text" class="layui-input" id="test2" placeholder="HH:mm:ss">
            </div>
        </div>
        <br/>
        <br/>
        <div class="layui-form-item">
            <label class="layui-form-label" style="font-size: 22px;width: 120px;margin-left: -20px">单选试题数</label>
            <div class="layui-input-block" style="width: 250px;margin-left: 20%">
                <input type="text" name="odd" lay-verify="required" value="40" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="font-size: 22px;width: 120px;margin-left: -20px">多选试题数</label>
            <div class="layui-input-block" style="width: 250px;margin-left: 20%">
                <input type="text" name="more" lay-verify="required" value="10" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div id="divbat" style="margin-left: 120px;margin-top: 70px">
            <button type="submit" id="btn1" class="layui-btn layui-btn-normal" onclick="tc()" style="font-size: 22px">完成编辑</button>
        </div>
    </form>
</div>
<script>
    layui.use(['layer','laydate','table','form'], function(){
        var layer=layui.layer;
        var laydate=layui.laydate;
        var table=layui.table;
        var form=layui.form;

        //常规用法
        laydate.render({
            elem: '#date1'
        });
        //时间选择器
        laydate.render({
            elem: '#test1'
            ,type: 'time'
        });
        //时间选择器
        laydate.render({
            elem: '#test2'
            ,type: 'time'
        });
/*
        function tc() {
            alert("成功添加到试卷信息表");
            $("#main")[0].reset();
        }*/
    });
    /*
    form.on("submit(doselect)",function () {
        alert(11111)
        $.ajax({
            type:"POST",
            url:"../PaperServlet",
            data:"method=add",
            success:function () {
               layer.msg("添加成功");
               setTimeout("location.reload()",3000);
           }
        });
    });*/
</script>
</body>
</html>
